package cn.com.huzo.model.entities.tech;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 补料单主记录实体类
 * <p>
 * @author 吴旭
 */
public class MrpFeedingHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 3182830787437907379L;
    private Long HeaderId;
    private String BillNo;                      // 补料单号
    private Integer FeedingTypeId;              // 补料类型标识
    private String FeedingTypeName;             // 补料类型（1、库存订料 2、生产补料 3、后勤用料）
    private Long ScheduledBy;                   // 订料人标识
    private String ScheduledByName;             // 订料人名
    private Timestamp ScheduledDate;            // 订料日期
    private String Description;                 // 备注
    private Boolean QuotedFlag;                 // 被订单引用标记
    private Boolean PoOverFlag;                 // 订单完成标记
    private Boolean PoOpeningRows;              // 订单是否全部引用了调达标记
    private Boolean PoNoticeFlag;               // 采购通知标记

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getBillNo() {
        return BillNo;
    }

    public void setBillNo(String BillNo) {
        this.BillNo = BillNo;
    }

    public Integer getFeedingTypeId() {
        return FeedingTypeId;
    }

    public void setFeedingTypeId(Integer FeedingTypeId) {
        this.FeedingTypeId = FeedingTypeId;
    }

    public String getFeedingTypeName() {
        return FeedingTypeName;
    }

    public void setFeedingTypeName(String FeedingTypeName) {
        this.FeedingTypeName = FeedingTypeName;
    }

    public Long getScheduledBy() {
        return ScheduledBy;
    }

    public void setScheduledBy(Long ScheduledBy) {
        this.ScheduledBy = ScheduledBy;
    }

    public String getScheduledByName() {
        return ScheduledByName;
    }

    public void setScheduledByName(String ScheduledByName) {
        this.ScheduledByName = ScheduledByName;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getScheduledDate() {
        return ScheduledDate;
    }

    public void setScheduledDate(Timestamp ScheduledDate) {
        this.ScheduledDate = ScheduledDate;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public Boolean getQuotedFlag() {
        return QuotedFlag;
    }

    public void setQuotedFlag(Boolean QuotedFlag) {
        this.QuotedFlag = QuotedFlag;
    }

    public Boolean getPoOverFlag() {
        return PoOverFlag;
    }

    public void setPoOverFlag(Boolean PoOverFlag) {
        this.PoOverFlag = PoOverFlag;
    }

    public Boolean getPoOpeningRows() {
        return PoOpeningRows;
    }

    public void setPoOpeningRows(Boolean PoOpeningRows) {
        this.PoOpeningRows = PoOpeningRows;
    }

    public Boolean getPoNoticeFlag() {
        return PoNoticeFlag;
    }

    public void setPoNoticeFlag(Boolean PoNoticeFlag) {
        this.PoNoticeFlag = PoNoticeFlag;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MrpFeedingHeaderEntity)) {
            return false;
        }

        final MrpFeedingHeaderEntity that = (MrpFeedingHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
